package com.telecom.controller.admin;

import com.telecom.common.convention.result.Result;
import com.telecom.pojo.dto.admin.employee.EmployeeLoginDTO;
import com.telecom.pojo.vo.admin.employee.EmployeeLoginVO;
import com.telecom.service.EmployeeService;
import jakarta.annotation.Resource;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import jakarta.validation.Valid;

/**
 * 管理员相关接口
 */
@RestController
@RequestMapping("/admin/employee")
@Slf4j
public class EmployeeController {

    @Resource
    EmployeeService employeeService;

    /**
     * 管理员登录
     * 
     * @param loginRequest 登录请求参数
     * @return 登录结果
     */
    @PostMapping("/login")
    public Result<EmployeeLoginVO> login(@RequestBody @Valid EmployeeLoginDTO loginRequest) {
        return Result.success(employeeService.login(loginRequest));
    }

    /**
     * 退出登录
     * 
     * @return 退出结果
     */
    @PostMapping("/logout")
    public Result<Void> logout() {
        return Result.success();
    }
}